struct ListNode *detectCycle(struct ListNode *head) {
    struct ListNode* slow=head,*fast=head;
    while(fast && fast->next)
    {
        fast=fast->next->next;
        slow=slow->next;
    
    if(slow==fast)
    {
        struct ListNode* meet=slow;
        while(meet!=head)
        {
            meet=meet->next;
            head=head->next;
        }
        return meet;
    }
    }
    return NULL;
    
}